#include "gtlEvent.h"
#include <GTL/gtlAutomember.h>

namespace GTL { namespace Engine {
/*
eastl::vector<Event::EventHandler> Event::Handlers;

void Event::RegisterEventHandler( const char* obj_class, const char* func_name, FunctionParamDescriptor descriptor, CallerType caller, char* pointer, int ptrsize )
{
	bool found = false;
	for (size_t i=0; i<Handlers.size(); i++)
	{
		if(!memcmp(pointer, Handlers[i].FunctionPointer, ptrsize))
		{
			found = true;
			break;
		}
	}
	if (found)
	{
		delete[] pointer;
		return;
	}
	EventHandler handler = {obj_class, func_name, descriptor, caller, pointer};
	Handlers.push_back( handler );
}
*/
	int Event::CallEvent( EventHandler* handler, const GTL::Functions::VariableVariant* args, size_t argc )
	{
	/*
	for (size_t i=0; i<Handlers.size(); i++)
	{
		if(!strcmp(classname, Handlers[i].ObjClass) && !strcmp(funcname, Handlers[i].FuncName))
		{
			return Handlers[i].CallerFunction(Handlers[i].FunctionPointer, p, args);
			break;
		}
	}*/
	handler->CallerFunction(handler->FunctionPointer, handler->Object, args, argc, handler->FuncName);
	return 0;
}

}}